<template>
  <div>
    <el-row>
      <el-col :span="12">
        <el-form-item label="提现金额:" prop="withdrawAmount">
          <el-input v-model="model.withdrawAmount" maxlength="10" placeholder="请输入">
            <template slot="append">元</template>
          </el-input>
        </el-form-item>
      </el-col>
    </el-row>
  </div>
</template>

<script>
/*
if (this.model.careExpense) {
  const regMobile = /(^[0-9]+(\.[0-9]{1,2})?$)/
  if (!regMobile.test(this.model.careExpense)) {
    this.$message.warning('养老服务费用格式不正确！(只允许数字 并最多保留2位小数)')
    return
  }
}

// 金额 保留2位小数
export function validatorMoney(rule, value, callback) {
  const regMobile = /(^[0-9]+(\.[0-9]{1,2})?$)/
  if (!regMobile.test(value)) {
    callback(new Error('金额格式不正确！(最多保留2位小数)'))
  } else {
    callback()
  }
}
// 通用 保留2位小数
export function validatorNumTwoDecimals(rule, value, callback) {
  const regMobile = /(^[0-9]+(\.[0-9]{1,2})?$)/
  if (!regMobile.test(value)) {
    callback(new Error('格式不正确！(最多保留2位小数)'))
  } else {
    callback()
  }
}
*/
import { validatorMoney } from '@/utils/validate'

export default {
  data() {
    return {
      rules: {
        withdrawAmount: [
          { required: true, message: '请输入', trigger: 'blur' },
          { validator: validatorMoney, trigger: 'blur' }
        ]
      }
    }
  }
}
</script>

<style lang="scss" scoped>
</style>

